package com.sghj.SysPermission.entity.Vo;

import com.baomidou.mybatisplus.annotation.*;
import com.sghj.utils.ValidateUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * @author xrx
 * @Date 2022/2/26
 * @apiNote
 */
@Data
public class roleAddVo {

    @ApiModelProperty(value = "角色ID")
    @TableId(value = "SysRoleId", type = IdType.AUTO)
    private Integer SysRoleId;

    @ApiModelProperty(value = "角色名称")
    @TableField("SysRoleName")
    @Pattern(regexp = ValidateUtil.UNBLANK_PATTERN,message = "角色名称不规范")
    @Size(min = 2,max = 10,message = "角色名称长度为2-10个字符")
    private String SysRoleName;

    @ApiModelProperty(value = "权限字符")
    @Pattern(regexp = ValidateUtil.UNBLANK_PATTERN,message = "权限字符不规范")
    @Size(min = 2,max = 10,message = "权限字符长度为2-10个字符")
    private String roleKey;

    @ApiModelProperty(value = "数据范围")
    private Integer dataScope;

    @ApiModelProperty(value = "显示排序")
    @TableField("DisplayOrder")
    @DecimalMin(value = "0",message = "输入必须为大于0的数字")
    private Integer DisplayOrder;

    @ApiModelProperty(value = "0可用 1删除")
    @TableField("is_delete")
    @TableLogic
    private Integer isDelete;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "备注")
    //@Pattern(regexp = ValidateUtil.UNBLANK_PATTERN,message = "备注格式有误")
    @Size(max = 200)
    @TableField("remark")
    private String remark;
    private int[] menuIds;
}
